﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="课后1.aspx.cs" Inherits="WebApplication1.课后1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        .auto-style1 {
            width: 520px;
        }
                table{
            border: 1px solid rgb(185, 185, 185);
            border-radius: 5px;
            border-collapse: collapse;
            padding: 5px;
        }
        td{
            border: 1px solid rgb(88, 26, 26);
            padding: 8px;
        }
        .auto-style2 {
            margin-left: 40px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <h3>网址验证：</h3>
            输入网址：<asp:TextBox ID="TextBox1" runat="server" Width="217px"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="你输入的不是一个网址！" ForeColor="#FF3399" ValidationExpression="http(s?)://([\w]+\.){1}([\w]+\.?)+"></asp:RegularExpressionValidator>
            <asp:Button ID="Button1" runat="server" Text="test" />
        </div>
        <div>
            <h3>验证日期：</h3>
            出生日期：<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="TextBox2" Display="Dynamic" ErrorMessage="以mm/dd/yyyy或者m/d/yyyy输入日期！" ForeColor="Red" ValidationExpression="^(0?[1-9]|1[0-2])[\/](0?[1-9]|[12]\d|3[01])[\/](19|20)\d{2}$"></asp:RegularExpressionValidator>
            <asp:Button ID="Button2" runat="server" Text="test" />
        </div>
        <div>
            <h3>注册页面验证：</h3>
            <body>
    <table>
        <th colspan="2">
            用户注册
        </th>
        <tr>
            <td>用户名</td>
            <td class="auto-style1">
                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox3" Display="Dynamic" ErrorMessage="用户名不可以留空" ForeColor="#FF5050"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>密码</td>
            <td class="auto-style1">
                输入密码： <asp:TextBox ID="TextBox4" runat="server" TextMode="Password"></asp:TextBox>
                <br />
                确认密码： <asp:TextBox ID="TextBox5" runat="server" TextMode="Password"></asp:TextBox>
                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="TextBox4" ControlToValidate="TextBox5" Display="Dynamic" ErrorMessage="密码不相同" ForeColor="#FF5050"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td>e-mail</td>
            <td class="auto-style1">
                <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="TextBox6" Display="Dynamic" ErrorMessage="邮箱格式不正确" ForeColor="#FF5050" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>性别</td>
            <td class="auto-style1">
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal" Width="171px" Height="29px">
                    <asp:ListItem Selected="True">男</asp:ListItem>
                    <asp:ListItem Value="女"></asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td>年龄</td>
            <td class="auto-style1">
                <asp:TextBox ID="TextBox7" runat="server" Width="87px"></asp:TextBox>
                <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="年龄不可以小于15岁" ControlToValidate="TextBox7" Display="Dynamic" ForeColor="#FF5050" MaximumValue="300" MinimumValue="15" Type="Integer"></asp:RangeValidator>
            </td>
        </tr>
        <tr>
            <td>注册日期</td>
            <td class="auto-style1">
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="auto-style2">
                    <asp:Button ID="Button3" runat="server" Text="注册" Width="243px" />
                <asp:Button ID="Button4" runat="server" Text="取消" Width="286px" />
            </td>
            
        </tr>
    </table>
</body>
        </div>
    </form>
</body>
</html>
